<body class="wy-body">
<div class="layui-fluid">
	<div class="layui-card">
		<div class="layui-card-header wy-card-header-auto">
			<span class="layadmin-font-em">模型：<span class="layui-badge-rim">{$table_info.name}</span>&nbsp;&nbsp;&nbsp;</span>
			<span class="layadmin-font-em">模型ID：<span class="layui-badge-rim">{$table_info.id}</span></span>
		</div>
		<div class="layui-form layui-card-header wy-card-header-auto">
			<div class="layui-form-item">
				<form action="{:url(request()->action())}" method="get">
				<input type="hidden" name="table_id" value="{$get_data.table_id}">
				<div class="layui-inline">
					<label class="layui-form-label wy-width-auto">别名</label>
					<div class="layui-input-inline">
						<input type="text" name="cname" placeholder="请输入别名" autocomplete="off" class="layui-input" value="{$get_data.cname}">
					</div>
				</div>
				<div class="layui-inline">
					<label class="layui-form-label wy-width-auto">字段</label>
					<div class="layui-input-inline">
						<input type="text" name="field_name" placeholder="请输入字段" autocomplete="off" class="layui-input" value="{$get_data.field_name}">
					</div>
				</div>
				<div class="layui-inline">
					<label class="layui-form-label wy-width-auto">分組</label>
					<div class="layui-input-inline">
						<select name="type_group_id">
							<option value="">--请选择--</option>
							{foreach $type_group as $key=>$vo }
							<option value="{$key}" {if $get_data.type_group_id == strval($key)} selected {/if}>{$vo}</option>
							{/foreach}
						</select>
					</div>
				</div>
				<div class="layui-inline">
					<label class="layui-form-label wy-width-auto">状态</label>
					<div class="layui-input-inline">
						<select name="status">
							<option value="">--请选择--</option>
							<option value="1" {if $get_data.status == '1'} selected {/if}>启用</option>
							<option value="0" {if $get_data.status == '0'} selected {/if}>禁用</option>
						</select>
					</div>
				</div>
				<div class="layui-inline">
					<button class="layui-btn">
						<i class="layui-icon layui-icon-search"></i>
					</button>
				</div>
				</form>
			</div>
		</div>

		<div class="layui-card-body">
			<div style="padding-bottom: 10px;">
				<button class="layui-btn wy_but"
					wy-event="lay_parent_tab"
					wy-url="{:url('add')}?table_id={$table_info.id}"
					wy-id="contentfield_info"
					wy-title="添加字段"
				>添加</button>
			</div>
<table class="layui-table" name="wy_table_lists" lay-filter="wy_table_lists"
	lay-data="{
		height:'full-168',
		cellMinWidth:'180',
		url:'{:url('ajax_lists')}',
		where: {
				{$get_str}
			},
		method:'post',
		page:true,
		id:'wy_table_lists',
		limits:[15,30,50,100]}"
>
<thead>
<tr>
	<th lay-data="{width:'80',field:'id'}">ID</th>
	<th lay-data="{width:'120',field:'cname'}">别名</th>
	<th lay-data="{width:'120',field:'field_name'}">字段</th>
	<th lay-data="{width:'100',field:'type_group_name'}">分组</th>
	<th lay-data="{width:'110',field:'type_name'}">类型</th>
	<th lay-data="{width:'80',field:'sort'}">排序</th>
	<th lay-data="{width:'120',templet:'#is_requiredTool'}">是否必填</th>
	<th lay-data="{width:'120',templet:'#is_navTool'}">是否列表</th>
	<th lay-data="{width:'120',templet:'#is_searchTool'}">是否查询</th>
	<th lay-data="{width:'120',templet:'#statusTool'}">状态</th>
	<th lay-data="{field:'create_date'}">添加时间</th>
	<th lay-data="{toolbar:'#barTool'}">操作</th>
</tr>
</thead>
</table>

		</div>
	</div>
</div>
<script type="text/html" id="is_navTool">
{{# if(d.is_nav == 1){ }}
	<span class="layui-btn layui-btn-xs layui-btn-success">显示</span>
{{# }else{ }}
	
{{# } }}
</script>
<script type="text/html" id="is_requiredTool">
{{# if(d.is_required == 1){ }}
	<span class="layui-btn layui-btn-xs layui-btn-success">必填</span>
{{# }else{ }}
	
{{# } }}
</script>
<script type="text/html" id="is_searchTool">
{{# if(d.is_search == 1){ }}
	<span class="layui-btn layui-btn-xs layui-btn-success">查询</span>
{{# }else{ }}
	
{{# } }}
</script>

<script type="text/html" id="statusTool">
{{# if(d.status == 1){ }}
	<span class="layui-btn layui-btn-xs layui-btn-success">启用</span>
{{# }else{ }}
	<span class="layui-btn layui-btn-xs layui-btn-disabled">禁用</span>
{{# } }}
</script>
<script type="text/html" id="barTool">
<div class="layui-btn-group">
	<a class="layui-btn layui-btn-xs layui-btn-primary wy_but"
		wy-event="lay_parent_tab"
		wy-url="{:url('edit')}?id={{d.id}}&table_id={$table_info.id}"
		wy-id="contentfield_info"
		wy-title="编辑字段"
	>编辑</a>

	<a class="layui-btn layui-btn-xs layui-btn-primary wy_but"
		wy-event="lay_ajax_get"
		wy-url="{:url('del')}?id={{d.id}}&table_id={$table_info.id}"
		wy-tips="确认是否删除该信息，删除以后将无法恢复"
		wy-table="wy_table_lists"
	>删除</a>
</div>
</script>
</body>